package com.abc.core.def;

import lombok.Data;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

@Data
public class Dna {

    private long id;
    private String dnaCode;
    private String dnaName;
    private String dnaDescription;
    private String dbMapCode;
    private boolean cursive;
    private int order;
    private List<Dna> children = new ArrayList<Dna>();
    private List<Vd> vds = new ArrayList<Vd>();
    private transient LocalDateTime lastTime;

    private Integer minCount;
    private Integer maxCount;

    public Dna(String dnaCode, String dnaName, String dnaDescription) {
        this.dnaCode = dnaCode;
        this.dnaName = dnaName;
        this.dnaDescription = dnaDescription;
    }

    public void addVd(Vd vd) {
        vds.add(vd);
    }

    public void setMultiple(int min, int max) {
        this.minCount = min;
        this.maxCount = max;
    }

    public void addChild(Dna childDna) {
        children.add(childDna);
    }

    public Dna getDnaByName(String childDnaName) {
        return null;
    }
}
